home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 3
/
ct-rom iiib.zip
/
ct-rom iiib
/
WINDOWS
/
UTILITY
/
DESKTOP
/
W_ONE49
/
WOIO.H_
/
WOIO.H
Wrap
C/C++ Source or Header
|
1994-04-27
|
8KB
|
255 lines
/******************************************************************\
* *
* w w oooo *
* w w iii n n o o n n eeee *
* w w i nn n o o nn n e *
* w w w i n n n o o n n n eee *
* w w w w i n nn o o n nn e *
* w w iii n n oooo n n eeee *
* *
* C o m m a n d L a n g u a g e I n t e r p r e t e r *
* *
* *
* Written by Lucien Cinc *
* Copyright (c) 1992, 1993 *
* *
* *
* For a complete description of all the functions in this file *
* see the WOIO.HLP help file. WOIO.HLP is located in the sub- *
* directory WOIO, for example :- *
* *
* C:\WIN_ONE\WOIO\WOIO.HLP *
* *
* Note: To view this file from WinOne use the /4 switch for *
* command TYPE, since I use only 4 spaces for tab *
* characters, for example :- *
* *
* TYPE WOIO.H /4 *
* *
\******************************************************************/
#ifndef __WOIO_H
#define __WOIO_H
#include <windows.h>
#include <bwcc.h>
/*
include stdio.h here so that the macros putchar
and getchar can be removed!
*/
#include <stdio.h>
#include <dir.h>
#ifdef putchar
#undef putchar
#endif /* putchar */
#ifdef getchar
#undef getchar
#endif /* getchar */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define BLACK (char )128 /* text colours */
#define RED (char )129
#define GREEN (char )130
#define BLUE (char )131
#define YELLOW (char )132
#define MAGENTA (char )133
#define CYAN (char )134
#define WHITE (char )135
#define LIGHTGRAY (char )136
#define LIGHTRED (char )137
#define LIGHTGREEN (char )138
#define LIGHTBLUE (char )139
#define BROWN (char )140
#define LIGHTMAGENTA (char )141
#define LIGHTCYAN (char )142
#define DARKGRAY (char )143
/*******************************\
* *
* Control Functions *
* *
\*******************************/
#define BUFFERED 1 /* screen output */
#define UNBUFFERED 0
void screen(int flag); /* buffered screen output */
void yield(void); /* alow other tasks to multitask */
/*******************************\
* *
* Screen Output Functions *
* *
\*******************************/
int printf(const char *fmt, ...); /* printf formated output */
int puts(const char *s); /* string output + CR-LF */
int putchar(const int c); /* character output */
int putch(int c); /* character output */
void perror(const char *msg); /* display an error message */
void textcolor(int col); /* set the text colour */
void clrscr(void); /* clear the screen */
void clreol(void); /* clear till end of line */
void gotoxy(int x, int y); /* position cursor on screen */
int wherex(void); /* location of caret (horizontal) */
int wherey(void); /* location of caret (vertical) */
int scrwidth(void); /* screen width in characters */
int scrheight(void); /* screen height in character */
char *atoc(char *number); /* insert comma's into a number */
/*******************************\
* *
* Input Functions *
* *
\*******************************/
int scanf(const char *fmt, ...); /* scanf formated input */
char *gets(char *s); /* get a string */
int getchar(void); /* get a character */
int getch(void); /* get a character no echo */
/*******************************\
* *
* Command Line Functions *
* *
\*******************************/
int argc(void); /* number of arguments */
char *argv(int index); /* get an argument */
int argn(void); /* number of switches */
char *args(void); /* get all switches */
char *argpath(int index); /* get path argument */
char *argabs(int index); /* get absolute path argument */
char *argtail(void); /* get command line tail */
char *argstr(int index); /* get command line string */
int argnstr(void); /* number of command line strings */
BOOL isargstr(int index); /* is an argument a string */
/*******************************\
* *
* Status Bar Functions *
* *
\*******************************/
void limit(unsigned long upper); /* status bar upper limit */
void inc(unsigned long value); /* status bar increment by value */
void empty(void); /* empty status bar */
/*******************************\
* *
* File manipulation Functions *
* *
\*******************************/
#define INC_BYTE 0 // u_flag's for status bar updating
#define INC_ONE 1
#define INC_NONE 2
#define O_OPEN 0 // o_flag's for opening dest file
#define O_CREATE 1
#define O_CREATNEW 2
long filesize(char *path);
long filecpy(char *dst, char *src, int o_flag, int u_flag);
long filecat(char *dst, char *src, int u_flag);
long filencpy(char *dst, char *src, long num, long offset, int o_flag, int u_flag);
long filencat(char *dst, char *src, long num, long offset, int u_flag);
/*******************************\
* *
* File Name Functions *
* *
\*******************************/
#define ATT_RHSDA (unsigned int )(FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_DIREC|FA_ARCH)
#define ATT_RHSA (unsigned int )(FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH)
int fillfile(char *path, unsigned int attr); /* block file fill */
BOOL getfile(int index, struct ffblk *pff); /* get file ffblk */
char *getfilepath(int index); /* get file path, may not be a fully qualified path */
char *getfilename(int index); /* get file name */
char *padfilename(char *path); /* pad a filename for displaying */
/*******************************\
* *
* Path Functions *
* *
\*******************************/
int fillpath(char *path); /* block path fill */
int fillpathall(void); /* block path fill for all drives */
void freepaths(void); /* free paths */
char *getpath(int index); /* get a path */
int totalfiles(void); /* total number of files in paths */
/*******************************\
* *
* Unix conversion functions *
* *
\*******************************/
char *unixpath(char *path); /* convert dos path to unix */
char *unixcmd(char *cmd); /* convert dos command to unix */
int isunix(void); /* unix mode flag */
char *todospath(char *path); /* convert unix path to dos */
char *todoscmd(char *cmd); /* convert unix command to dos */
/*******************************\
* *
* File Description Functions *
* *
\*******************************/
char *getdesc(char *path); /* get a file description */
int setdesc(char *path, char *str); /* set a file description */
int deldesc(char *path); /* delete a file description */
/*******************************\
* *
* Environment Functions *
* *
\*******************************/
char *getenvironment(char *name); /* get WinOne environment variable */
int putenvironment(char *name); /* set WinOne environment variable */
/*******************************\
* *
* System Call *
* *
\*******************************/
int _FARFUNC system(const char _FAR * c);
/*******************************\
* *
* Global Variables *
* *
\*******************************/
HINSTANCE gethinst(void);
extern char *arg_v[]; /* argv */
extern int arg_c; /* argc */
extern int errcnt; /* perror counter */
extern int main(void); /* program entry point */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __WOIO_H */